package io.seata.samples.integration.storage.controller;

import io.seata.samples.integration.service.ITStorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * * @author lidong
 * @since 2019-09-04
 */
@RestController
@Slf4j
public class TStorageController {


    @Autowired
    private ITStorageService storageService;

    /**
     * 扣减库存
     */
    @PutMapping("storage/decstorage/{id}/{count}")
    public String  decreaseStorage(@PathVariable("id") Integer id,@PathVariable("count") int count){
        return storageService.decreaseStorage(id,count)+"";
    }
}

